#!/bin/bash

# 重启所有服务
# Restart All Services

set -e

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"

cd "$PROJECT_ROOT"

echo "🔄 重启所有服务..."
echo ""

# 停止所有服务
./scripts/stop-all.sh

echo ""
echo "⏳ 等待 3 秒..."
sleep 3

# 启动数据库
./scripts/start-databases.sh

echo ""
echo "⏳ 等待数据库完全启动..."
sleep 5

# 启动应用服务
./scripts/start-services.sh

echo ""
echo "✅ 所有服务重启完成！"
